import request from '@/utils/request'

// 查询ETL数据源信息列表
export function listDatasource(query) {
    return request({
        url: '/kettle/datasource/list',
        method: 'get',
        params: query
    })
}

// 查询ETL数据源信息详细
export function getDatasource(id) {
    return request({
        url: '/kettle/datasource/' + id,
        method: 'get'
    })
}

// 新增ETL数据源信息
export function addDatasource(data) {
    return request({
        url: '/kettle/datasource',
        method: 'post',
        data: data
    })
}

// 修改ETL数据源信息
export function updateDatasource(data) {
    return request({
        url: '/kettle/datasource',
        method: 'put',
        data: data
    })
}

// 删除ETL数据源信息
export function delDatasource(id) {
    return request({
        url: '/kettle/datasource/' + id,
        method: 'delete'
    })
}
// 测试连接信息
export function testConnection(data) {
  return request({
    url: '/kettle/datasource/testConnection',
    method: 'post',
    data: data
  })
}
